home *** CD-ROM | disk | FTP | other *** search
/ ProGames 6 / PROGAMES.iso / player.dxr / 00002_Slide Frame Behaviour.ls < prev    next >
Encoding:
Text File  |  2003-06-22  |  5.3 KB  |  196 lines

  1. property slideList, currentPositionInList
  2. global soundActive, whichMenu, previewMode, firstmovie
  3.  
  4. on beginSprite me
  5.   activateFrameSound(the frameLabel)
  6.   myFrameName = the frameLabel
  7.   forwardButton = 1
  8.   backButton = 1
  9.   slideList = []
  10.   doesSlideExist = 0
  11.   repeat with n = 1 to member("settings").text.lines.count
  12.     if member("settings").text.line[n].item[1] contains myFrameName.char[1..8] then
  13.       if member("settings").text.line[n].item[3] = 1 then
  14.         add(slideList, member("settings").text.line[n].item[1])
  15.       end if
  16.     end if
  17.   end repeat
  18.   sort(slideList)
  19.   repeat with n = 1 to slideList.count
  20.     if getAt(slideList, n) = myFrameName then
  21.       currentPositionInList = n
  22.     end if
  23.   end repeat
  24.   if slideList.count = 3 then
  25.     if myFrameName.char[9] = getAt(slideList, 1).char[9] then
  26.       backButton = 0
  27.     end if
  28.     if myFrameName.char[9] = getAt(slideList, 3).char[9] then
  29.       forwardButton = 0
  30.     end if
  31.   end if
  32.   if slideList.count = 2 then
  33.     if myFrameName.char[9] = getAt(slideList, 1).char[9] then
  34.       backButton = 0
  35.     end if
  36.     if myFrameName.char[9] = getAt(slideList, 2).char[9] then
  37.       forwardButton = 0
  38.     end if
  39.   end if
  40.   if slideList.count = 1 then
  41.     backButton = 0
  42.     forwardButton = 0
  43.   end if
  44.   if backButton = 0 then
  45.     sprite(18).blend = 10
  46.   else
  47.     sprite(18).blend = 100
  48.   end if
  49.   if forwardButton = 0 then
  50.     sprite(19).blend = 10
  51.   else
  52.     sprite(19).blend = 100
  53.   end if
  54. end
  55.  
  56. on exitFrame me
  57.   case the rollover of
  58.     18:
  59.       if sprite(18).blend > 40 then
  60.         if member("button text").text <> "Previous" then
  61.           member("button text").text = "Previous"
  62.         end if
  63.       end if
  64.     19:
  65.       if sprite(19).blend > 40 then
  66.         if member("button text").text <> "Next" then
  67.           member("button text").text = "Next"
  68.         end if
  69.       end if
  70.     20:
  71.       if sprite(20).blend > 40 then
  72.         if member("button text").text <> member("mainmenu title").text then
  73.           member("button text").text = member("mainmenu title").text
  74.         end if
  75.       end if
  76.     21:
  77.       if sprite(21).blend > 40 then
  78.         if member("button text").text <> "Exit" then
  79.           member("button text").text = "Exit"
  80.         end if
  81.       end if
  82.     otherwise:
  83.       if member("button text").text <> EMPTY then
  84.         member("button text").text = EMPTY
  85.       end if
  86.   end case
  87.   go(the frame)
  88. end
  89.  
  90. on mouseUp me
  91.   if firstmovie = 1 then
  92.     case the rollover of
  93.       18:
  94.         if sprite(18).blend > 40 then
  95.           if soundActive = 1 then
  96.             puppetSound(4, "click")
  97.           end if
  98.         end if
  99.         if sprite(18).blend > 40 then
  100.           play frame getAt(slideList, currentPositionInList - 1)
  101.         end if
  102.       19:
  103.         if sprite(19).blend > 40 then
  104.           if soundActive = 1 then
  105.             puppetSound(4, "click")
  106.           end if
  107.         end if
  108.         if sprite(19).blend > 40 then
  109.           play frame getAt(slideList, currentPositionInList + 1)
  110.         end if
  111.       20:
  112.         if sprite(20).blend > 40 then
  113.           if soundActive = 1 then
  114.             puppetSound(4, "click")
  115.           end if
  116.         end if
  117.         play frame whichMenu
  118.       21:
  119.         if sprite(21).blend > 40 then
  120.           if soundActive = 1 then
  121.             puppetSound(4, "click")
  122.           end if
  123.         end if
  124.         userending = 0
  125.         repeat with checkexit = 1 to member("settings").text.lines.count
  126.           if member("settings").text.line[checkexit].item[1] = "endslide" then
  127.             if member("settings").text.line[checkexit].item[3] = 1 then
  128.               userending = 1
  129.             end if
  130.           end if
  131.         end repeat
  132.         if userending = 1 then
  133.           play frame "endslide"
  134.         else
  135.           if previewMode = 1 then
  136.             play movie "layout"
  137.           else
  138.             play frame "exitframe"
  139.           end if
  140.         end if
  141.     end case
  142.   else
  143.     firstmovie = 1
  144.     case the rollover of
  145.       18:
  146.         if sprite(18).blend > 40 then
  147.           if soundActive = 1 then
  148.             puppetSound(4, "click")
  149.           end if
  150.         end if
  151.         if sprite(18).blend > 40 then
  152.           play frame string(getAt(slideList, currentPositionInList - 1) & "-a")
  153.         end if
  154.       19:
  155.         if sprite(19).blend > 40 then
  156.           if soundActive = 1 then
  157.             puppetSound(4, "click")
  158.           end if
  159.         end if
  160.         if sprite(19).blend > 40 then
  161.           play frame string(getAt(slideList, currentPositionInList + 1) & "-a")
  162.         end if
  163.       20:
  164.         if sprite(20).blend > 40 then
  165.           if soundActive = 1 then
  166.             puppetSound(4, "click")
  167.           end if
  168.         end if
  169.         play frame whichMenu
  170.       21:
  171.         if sprite(21).blend > 40 then
  172.           if soundActive = 1 then
  173.             puppetSound(4, "click")
  174.           end if
  175.         end if
  176.         userending = 0
  177.         repeat with checkexit = 1 to member("settings").text.lines.count
  178.           if member("settings").text.line[checkexit].item[1] = "endslide" then
  179.             if member("settings").text.line[checkexit].item[3] = 1 then
  180.               userending = 1
  181.             end if
  182.           end if
  183.         end repeat
  184.         if userending = 1 then
  185.           play frame "endslide-a"
  186.         else
  187.           if previewMode = 1 then
  188.             play movie "layout"
  189.           else
  190.             play frame "exitframe"
  191.           end if
  192.         end if
  193.     end case
  194.   end if
  195. end
  196.